home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2001 January / MacHome Magazine Demo Disc January 2001.iso / mac / Software / Networking / InterMapper 3.0 - PPC.sea / InterMapper 3.0 - PPC / InterMapper™ 3.0-PPC / InterMapper™ 3.0-PPC.rsrc / PrTy_159_com.dartware.tcp.imap4 < prev    next >
Encoding:
Text File  |  2000-07-24  |  2.0 KB  |  79 lines

  1. <!-- 
  2.     IMAP4 (com.dartware.tcp.imap4)
  3.     Copyright © 2000 Dartware, LLC. All rights reserved.
  4. -->
  5.  
  6. <header>
  7.     type            =     "tcp-script"
  8.     package            =     "com.dartware"
  9.     probe_name        =    "tcp.imap4"
  10.     human_name        =    "IMAP4"
  11.     version            =     "1.1"
  12.     address_type    =     "IP"
  13.     port_number        =    "143"
  14.     
  15.     old_protocol    =     "8"            # Backward compat. with old numbering scheme.
  16.     old_script        =     "8012"
  17.  
  18. </header>
  19.  
  20. <description>
  21.  
  22. ≤GB≥Internet Message Access Protocol - Version 4≤P≥
  23.  
  24. The protocol used for accessing and manipulating email messages on a server, as defined in ≤U2≥RFC 2060≤P0≥.  The default TCP port number for IMAP4 connections is port 143.
  25.  
  26. This TCP script connects to the IMAP4 server and issues a CAPABILITY command, a NOOP command, and finally terminates with a LOGOUT command.  The script checks the server's response to the CAPABILITY command to verify that the server supports IMAP4 or IMAP4rev1.
  27.  
  28. </description>
  29.  
  30. <parameters>
  31.  
  32. -- no parameters
  33.  
  34. </parameters>
  35.  
  36. <script>
  37.  
  38. CONN #60 (connect timeout in secs)
  39. WAIT #30 @IDLE (idle timeout in secs)
  40. MTCH "* OK" else goto @CHECK_PREAUTH
  41. @BEGIN:
  42. SEND "A001 CAPABILITY\r\n"
  43. EXPT "* CAPABILITY" else goto @DISCONNECT
  44. MTCH "IMAP4"i else goto @UNRECOGNIZED_CAPABILITY
  45. SKIP "* " else goto @DISCONNECT
  46. MTCH "A001 OK" else goto @UNEXPECTED_RESPONSE
  47. SEND "A002 NOOP\r\n"
  48. SKIP "* " else goto @DISCONNECT
  49. MTCH "A002 " else goto @UNEXPECTED_RESPONSE
  50. STAT OKAY
  51. @LOGOUT:
  52. SEND "A003 LOGOUT\r\n"
  53. SKIP "* " #+2
  54. MTCH "A003 OK" #+1
  55. EXIT
  56.  
  57. @CHECK_PREAUTH:
  58. MTCH "* PREAUTH" else goto @UNEXPECTED_GREETING
  59. GOTO <BEGIN #4>
  60.  
  61. @UNEXPECTED_GREETING:
  62. DONE DOWN "[IMAP4] Unexpected greeting from port ${_REMOTEPORT}. (${_LINE:50})"
  63.  
  64. @DISCONNECT:
  65. DONE DOWN "[IMAP4] Connection disconnected while expecting \"${_STRINGTOMATCH}\"."
  66.  
  67. @UNRECOGNIZED_CAPABILITY:
  68. STAT ALRM "[IMAP4] Unrecognized CAPABILITY response. (${_LINE:50})"
  69. GOTO @LOGOUT
  70.  
  71. @UNEXPECTED_RESPONSE:
  72. STAT ALRM "[IMAP4] Unexpected response. (${_LINE:50})"
  73. GOTO @LOGOUT
  74.  
  75. @IDLE:
  76. DONE DOWN "[IMAP4] No data for ${_IDLETIMEOUT} seconds. Was expecting \"${_STRINGTOMATCH}\". [Line ${_IDLELINE}]"
  77.  
  78. </script>
  79.